<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActiveRecord::ReadonlyAttributes::ClassMethods</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Module</span> 
            ActiveRecord::ReadonlyAttributes::ClassMethods 
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/activerecord/lib/active_record/readonly_attributes_rb.html">activerecord/lib/active_record/readonly_attributes.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="ClassMethods.html#method-i-attr_readonly">attr_readonly</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="ClassMethods.html#method-i-readonly_attributes">readonly_attributes</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-attr_readonly">
            
              <b>attr_readonly</b>(*attributes)
            
            <a href="ClassMethods.html#method-i-attr_readonly" name="method-i-attr_readonly" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Attributes listed as readonly will be used to create a new record but
update operations will ignore these fields.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-attr_readonly_source')" id="l_method-i-attr_readonly_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b955939d55b71905fa3e5036149ee4c84943c599/activerecord/lib/active_record/readonly_attributes.rb#L14" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-attr_readonly_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/readonly_attributes.rb, line 14</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">attr_readonly</span>(*<span class="ruby-identifier">attributes</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">_attr_readonly</span> = <span class="ruby-constant">Set</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">to_s</span> }) <span class="ruby-operator">+</span> (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">_attr_readonly</span> <span class="ruby-operator">||</span> [])
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-readonly_attributes">
            
              <b>readonly_attributes</b>()
            
            <a href="ClassMethods.html#method-i-readonly_attributes" name="method-i-readonly_attributes" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Returns an array of all the attributes that have been specified as
readonly.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-readonly_attributes_source')" id="l_method-i-readonly_attributes_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b955939d55b71905fa3e5036149ee4c84943c599/activerecord/lib/active_record/readonly_attributes.rb#L19" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-readonly_attributes_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/readonly_attributes.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">readonly_attributes</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">_attr_readonly</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    